#pragma once
#include"_hashbucket.hpp"

template<class K, class V>
class unordered_map
{
	struct unordered_MapKeyofT
	{
		const K& operator()(const pair<K, V>& kv) {
			return kv.first;
		}
	};

public:
	typedef typename HashBucket<K, pair<const K, V>, unordered_MapKeyofT>::Iterator iterator;
	typedef typename HashBucket<K, pair<const K, V>, unordered_MapKeyofT>::const_Iterator const_iterator;

public:
	iterator begin()
	{
		return hash.begin();
	}

	iterator end()
	{
		return hash.end();
	}

	const_iterator begin() const
	{
		return hash.begin();
	}

	const_iterator end() const
	{
		return hash.end();
	}

	iterator find(const K& key)
	{
		return hash.Find(key);
	}

	pair<iterator,bool> insert(const pair<K, V>& kv) {
		return hash.Inser(kv);
	}

	bool erase(const K& key)
	{
		return hash.Erase(key);
	}

private:
	HashBucket<K, pair<const K, V>, unordered_MapKeyofT> hash;
};